<table cellpadding="0" cellspacing="2" width="100%;">
	<tr style="vertical-align: top; padding-top: 2px;">
		<td style="vertical-align: top; padding-top: 2px;" width="35%" height="100%" >
			<!-- 表名列表 -->
			<span *ngIf="tableList">
			<p-table [value]="tableList">
				<ng-template pTemplate="caption"> {{ "txt.dataIETables" | i18n}} </ng-template>
				<ng-template pTemplate="header">
					<tr>
						<th style="width: 70px;">{{ 'txt.TabGroupName' | i18n}}</th>
						<th style="width: 220px">{{ 'txt.TableName' | i18n}}</th>
						<th style="width: 250px">{{ 'txt.Description' | i18n}}</th>
					</tr>
				</ng-template>
				<ng-template pTemplate="body" pTemplate="body" let-tbl>
					<tr (click)="onSelectTable(tbl)" [class.selected]="tbl.isSelected">
						<td style="width: 70px">{{tbl.groupName}}</td>
						<td style="width: 220px">{{tbl.code}}</td>
						<td style="width: 250px">{{tbl.name}}</td>
					</tr>
				</ng-template>
			</p-table>
			</span>
		</td>
		<td style="vertical-align: top; padding-top: 2px; padding-left: 8px;" width="65%"><!-- 选定表的模板列表 -->
			<div *ngIf="selectedTable">
				<p-panel title="{{'txt.templateUploadZone' | i18n}}">
					<table cellspacing="0" cellpadding="0" class="tabframe1">
						<tr>
							<th>{{"txt.selectTemplate" | i18n}}：</th>
							<td><i-file-upload [fileUploadInfo]="tpltFileUploadInfo">Uploader here...</i-file-upload></td>
							<th><label for="fileDesc" style="font-size:17px;">{{ 'txt.TemplDesc' | i18n}}：</label></th>
							<td><input pInputText type="text" #fileDesc required [(ngModel)]="newTemplate.dscName" /> <font color="red">★</font></td>

						</tr>
						<tr>
							<td colspan="4">
								<div align="right">
										<p-button *ngIf="selectedTemplate == null" (click)="saveTemplate()" label="{{ 'txt.uploadNewTempl' | i18n}}"></p-button>
										<p-button *ngIf="selectedTemplate" (click)="saveTemplate()" label="{{ 'txt.updateTempl' | i18n}}"></p-button>
								</div>
							</td>
						</tr>
					</table>
				</p-panel>
				
				<p-table [value]="tableTemplates">
					<ng-template pTemplate="caption"> {{ "txt.templatesOfTable" | i18n : [selectedTable.name]}} </ng-template>
					<ng-template pTemplate="header">
						<tr>
							<th>ID</th>
							<th>{{ 'txt.Description' | i18n}}</th>
							<th>{{ 'txt.Uploader' | i18n}}</th>
							<th>{{ 'txt.UploadTime' | i18n}}</th>
							<th>{{ 'txt.Action' | i18n}}</th>
						</tr>
					</ng-template>
					<ng-template pTemplate="body" pTemplate="body" let-tmpl>
						<tr (click)="selectTemplate(tmpl)" [class.selected]="selectedTemplate == tmpl">
							<td>{{tmpl.id}}</td>
							<td>{{tmpl.dscName}}</td>
							<td>{{tmpl.createUser}}</td>
							<td>{{tmpl.createTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
							<td><i-file-link fileUri="tmpl.fileUri"></i-file-link> 
								<a class="edit" *ngIf="tmpl.id > 999" (click)="delTemplate(tmpl.id)">删除</a>
							</td>
						</tr>
					</ng-template>
				</p-table>
			</div>
		</td>
	</tr>
</table>
<i-mbox [isRunning]="isRunning()"></i-mbox>